package com.zf.yichat.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "user_print_tree_config")
public class UserPrintTreeConfig implements Serializable {
    @Id
    private Long id;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Long userId;

    /**
     * 用户昵称
     */
    private String nick;

    /**
     * 头像路径
     */
    private String avatar;

    /**
     * 浇水次数
     */
    @Column(name = "print_num")
    private Integer printNum;

    /**
     * 能量块数量
     */
    @Column(name = "block_num")
    private Integer blockNum;

    /**
     * 已解锁的树的数量
     */
    @Column(name = "current_tree")
    private Integer currentTree;

    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private static final long serialVersionUID = 1L;

    public UserPrintTreeConfig(Long id, Long userId, String nick, String avatar, Integer printNum, Integer blockNum, Integer currentTree, Date createTime) {
        this.id = id;
        this.userId = userId;
        this.nick = nick;
        this.avatar = avatar;
        this.printNum = printNum;
        this.blockNum = blockNum;
        this.currentTree = currentTree;
        this.createTime = createTime;
    }

    public UserPrintTreeConfig() {
        super();
    }

    /**
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return user_id - 用户ID
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * 设置用户ID
     *
     * @param userId 用户ID
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * 获取用户昵称
     *
     * @return nick - 用户昵称
     */
    public String getNick() {
        return nick;
    }

    /**
     * 设置用户昵称
     *
     * @param nick 用户昵称
     */
    public void setNick(String nick) {
        this.nick = nick == null ? null : nick.trim();
    }

    /**
     * 获取头像路径
     *
     * @return avatar - 头像路径
     */
    public String getAvatar() {
        return avatar;
    }

    /**
     * 设置头像路径
     *
     * @param avatar 头像路径
     */
    public void setAvatar(String avatar) {
        this.avatar = avatar == null ? null : avatar.trim();
    }

    /**
     * 获取浇水次数
     *
     * @return print_num - 浇水次数
     */
    public Integer getPrintNum() {
        return printNum;
    }

    /**
     * 设置浇水次数
     *
     * @param printNum 浇水次数
     */
    public void setPrintNum(Integer printNum) {
        this.printNum = printNum;
    }

    /**
     * 获取能量块数量
     *
     * @return block_num - 能量块数量
     */
    public Integer getBlockNum() {
        return blockNum;
    }

    /**
     * 设置能量块数量
     *
     * @param blockNum 能量块数量
     */
    public void setBlockNum(Integer blockNum) {
        this.blockNum = blockNum;
    }

    /**
     * 获取已解锁的树的数量
     *
     * @return current_tree - 已解锁的树的数量
     */
    public Integer getCurrentTree() {
        return currentTree;
    }

    /**
     * 设置已解锁的树的数量
     *
     * @param currentTree 已解锁的树的数量
     */
    public void setCurrentTree(Integer currentTree) {
        this.currentTree = currentTree == null ? null : currentTree;
    }

    /**
     * @return create_time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Transient
    private Integer nextUnlockNum;

    @Transient
    private Integer printedNum;

    @Transient
    private Integer currentNeedNum;

    public Integer getCurrentNeedNum() {
        return currentNeedNum;
    }

    public void setCurrentNeedNum(Integer currentNeedNum) {
        this.currentNeedNum = currentNeedNum;
    }

    public Integer getPrintedNum() {
        return printedNum;
    }

    public void setPrintedNum(Integer printedNum) {
        this.printedNum = printedNum;
    }

    public Integer getNextUnlockNum() {
        return nextUnlockNum;
    }

    public void setNextUnlockNum(Integer nextUnlockNum) {
        this.nextUnlockNum = nextUnlockNum;
    }
}